package com.yuju.login.enums;
/**
 * 
 * 类名：MenuReturnCodeEnum  <br />
 *
 * 功能：
 *
 * @author : zhousc <br />
 * @Date : 2017年12月4日 上午10:39:40  <br />
 * @version : 1.1 <br />
 */

public enum MenuReturnCodeEnum {
	MENU_QUERY_SUCCESS("yuju-menu-1000", "菜单查询成功"),
	MENU_QUERY_FAILURE("yuju-menu-1001", "菜单查询失败"),
	MENU_SAVE_SUCCESS("yuju-menu-1002", "菜单保存成功"),
	MENU_SAVE_FAILURE("yuju-menu-1003", "菜单保存失败"),
	MENU_UPDATE_SUCCESS("yuju-menu-1004", "菜单更新成功"),
	MENU_UPDATE_FAILURE("yuju-menu-1005", "菜单更新失败"),
	MENU_DEL_SUCCESS("yuju-menu-1006", "菜单删除成功"),
	MENU_DEL_FAILURE("yuju-menu-1007", "菜单删除失败");
	
	private String code;
	private String desc;
	
	MenuReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (MenuReturnCodeEnum enume : MenuReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}